1. Field of the Invention
The present invention relates to an image processing apparatus, control method, and storage medium. More particularly, the present invention relates to an image processing apparatus and image processing method to generate a blurring image having a blurring effect desirable even when one photographic image is divided into a plurality of regions.
2. Description of the Related Art
Recently, digital image sensing devices such as a digital camera and scanner have prevailed, and a photograph is frequently loaded as electronic data into a computer. The digital photographic image is edited using an application on the computer, and output from an output device such as a display or printer. Before outputting the photographic image from the output device, an image quality degrading factor such as backlight or dark noise generated in the photographic image is often corrected to display the photographic image with better appearance for the viewer.
One correction processing executed for a photographic image is blur processing. Blur processing is used to reduce noise generated in a photographic image. Blur processing is also used to generate an intermediate image when performing local luminance correction (dodging correction) utilizing the retinex theory.
Local luminance correction utilizing the retinex theory will be explained. According to retinex theory, the brightness distribution I of the object one visually perceives is based on a model expressed by multiplying the reflectance distribution R of the object surface by the illumination light distribution L:I=L·R   (1)
I: brightness distribution of the object
L: illumination light distribution
R: reflectance distribution of the object surface
(see, for example, “Media Information and Vision Technology in the 21st Century”, IEEJ Technical Report No. 981, Investigation Committee on Media Information and Vision Technology, pp. 41-45, Aug. 30, 2004).
In the model of the retinex theory, the reflectance distribution R of the object surface is a permanent property specific to the object. Thus, for example, a phenomenal factor such as backlight which localizes the brightness distribution I of the object is regarded to be accounted for not by the reflectance distribution R of the object surface but by the illumination light distribution L. A phenomenon such as backlight can be improved by correcting the illumination light distribution L as long as the brightness distribution I of the object can be extracted from a photographic image and divided into the illumination light distribution L and the reflectance distribution R of the object surface.
A center/surround model is proposed as a model for extracting the illumination light distribution L from the brightness distribution I of the object. The center/surround model assumes that the illumination light distribution L is a macroscopic change of the brightness distribution I of the object. A greatly blurring image is generated by applying a wide-range Gaussian filter to the brightness distribution I of the object. However, this blurring image reproduces neither a gradual brightness change in the object nor object contour in the photographic image. For this reason, middle- and narrow-range Gaussian filters are applied to the brightness distribution I of the object, generating moderately and weakly blurring images. The weakly, moderately, and greatly blurring images are composited at a predetermined ratio, and the resultant image is handled as the image of the illumination light distribution L. In this way, blur processing is an important technique in photographic image correction processing.
In some cases, however, blur processing is not simply applied. For example, when one photographic image is divided into a plurality of partial regions using a computer application, applying blur processing to the respective divided images causes a mismatch such as brightness discontinuity at the joint after recombination. In this case, according to Japanese Patent No. 03984346, blur processing is executed after calculating a weighted average at a portion where pixels overlap each other after division. This can reduce a mismatch such as brightness discontinuity at the joint.
However, an application generally divides an image not to produce a redundant pixel overlapping region. Hence, the method disclosed in Japanese Patent No. 03984346 is rarely applied. When a photographic image is divided into a plurality of regions not to produce a pixel overlapping region, two problems arise if blur processing is simply applied. The first problem is brightness discontinuity at the joint when images are combined again after blur filter processing because the pixels of the respective images are not referred to near the boundary between neighboring divided images in blur filter calculation. The second problem is that part of the blur filter falls outside an image to be processed near the division boundary, failing to obtain a blurring image with a good blurring effect.